const fs = require("fs");
const cheerio = require("cheerio");
module.exports = function(source, map) {
  const { resourcePath } = this;
  const file = fs.readFileSync(resourcePath);
  const $ = cheerio.load(file);
  console.log("\n", "----------------------------------");
  $("docs").remove();
  let otherHtml = $("body").html();
  console.log(otherHtml);
  this.callback(
    null,
    `export default function (Component) {
            Component.options.__sourceTitle = \`${source}\`
            Component.options.__sourceCode = \`${otherHtml}\`
            Component.options.__sourceCode = \`${otherHtml}\`
        }`,
    map
  );
};
